package com.wfs.spring.thread.Thread;

import com.wfs.spring.thread.MyThread;


/**
 * @Auther: wfs
 * @Date: 2019/6/13 20:01
 * @Description:
 */
public class Test1 {


    public static void main(String[] args) {
        try {
           /* String newString=new String("");
            System.out.println("syn 上面");
            synchronized (newString){
                System.out.println("syn 第一行");
                newString.wait();
                System.out.println("wait 下面");
            }*/
        /*   Object object=new Object();
          ThreadA thread1=new ThreadA(object);
          ThreadB thread2=new ThreadB(object);
           thread1.start();
           //Thread.sleep(1000);
           thread2.start();*/
        String look=new String("");
        Add add=new Add(look);
        Subtract subtract=new Subtract(look);
        ThreadSubtract threadSubtract=new ThreadSubtract(subtract);
            threadSubtract.setName(" subject 1");
            threadSubtract.start();
            /*ThreadSubtract threadSubtract2=new ThreadSubtract(subtract);
            threadSubtract2.setName(" subject 2");
            threadSubtract2.start();*/
            Thread.sleep(1000);
            ThreadAdd threadAdd=new ThreadAdd(add);
            threadAdd.setName("add");
            threadAdd.start();


        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
